# import time
#
#
#
# def how_much_time(func):
#     print("how_much_time函数开始了")
#     def inner():
#         print("how内部执行了")
#         t_start = time.time()
#         func()
#         t_end = time.time()
#         print("一共花费了{0}秒时间".format(t_end - t_start))
#     return inner
#
# def mylog(func):
#     print("mylog函数开始了")
#     def inner_1():
#         print("start")
#         func()
#         print("end")
#     return inner_1
#
#
# @mylog
# @how_much_time
# def sleep_5s():
#     time.sleep(5)
#     print("%d秒结束了" % (5,))
#
# if __name__ == '__main__':
#     sleep_5s()



# for i in range(65536):
#     print(chr(i)+ " ", end=" ")

# print(all([12, "哈啊", 56]))
# print(any([12, "哈啊", 0]))    # 当作or使用，有一个真则真
#
# list = ["张三", "李四", "王五", "赵六", "周末"]
# for index, item in enumerate(list):
#     print(index, item)


# testdatas = [
#     ({"username": "zkk1", "password": "123456"}, "success!", "输入正确账号，密码，登录成功"),
#     ({"username": "zkk2", "password": "1234567"}, "failed!", "输入错误账号，密码，登录失败"),
#     ({"username": "zkk3", "password": "1234568"}, "success!", "输入正确账号，密码，登录成功")]
# testdatas = ["1","2","3"]

# print(testdatas[0][0]["username"])

import pytest
# pytest.mark.paramtrize()参数化格式写法
# @pytest.mark.parametrize("input", testdatas)
# def test_case(input):
#     print("ascacac", input)
#     assert "1" in input

# 多个参数多个值
# @pytest.mark.parametrize("userName, passWord", [("xiaoqiang","123"),("xiaohong", "456")])
# def test_login(userName, passWord):
#     print(userName + ":" + passWord)

#多个参数混合使用
# data1 = [1, 2]
# data2 = ["python", "java"]
# data3 = ["赵", "钱", "孙", "李", "周"]
#
# @pytest.mark.parametrize("a", data1)
# @pytest.mark.parametrize("b", data2)
# @pytest.mark.parametrize("c", data3)
# def test_case3(a, b, c):
#     print(f"生成新的数据组合：[{a}{b}{c}]")



# def quanju():
#     a = 26
#     def neiceng():
#         nonlocal a
#         a = 13
#         print(a)
#     print(a)
#     return neiceng
#
# neiceng = quanju()
# print(neiceng())


from selenium import webdriver
driver = webdriver.Chrome()
driver.get("https://www.baidu.com")
